package cc.douquan.com.doutu.utils;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import cc.douquan.com.doutu.view.activity.AboutActivity;
import cc.douquan.com.doutu.view.activity.ClassityActivity;
import cc.douquan.com.doutu.view.activity.MycollectionActivity;
import cc.douquan.com.doutu.view.activity.SearchActivity;
import cc.douquan.com.doutu.view.activity.TypeActivity;
import cc.douquan.com.doutu.view.activity.WebActivity;

import static android.R.attr.id;
import static com.umeng.socialize.utils.DeviceConfig.context;

/**
 * activity跳转管理类
 */

public class UiHelper {
    public static void goSearchActivity(Context context, Bundle bundle) {
        Intent intent = new Intent();
        intent.setClass(context, SearchActivity.class);
        intent.putExtra("bundle", bundle);
        context.startActivity(intent);
    }

    public static void goCollectionActivity(Context context, Bundle bundle) {
        Intent intent = new Intent();
        intent.setClass(context, MycollectionActivity.class);
        intent.putExtra("bundle", bundle);
        context.startActivity(intent);
    }

    public static void goClassityActivity(Context context, int id) {
        Intent intent = new Intent();
        intent.setClass(context, ClassityActivity.class);
        intent.putExtra("id", id);
        context.startActivity(intent);
    }

    public static void goTypeActivity(Context mContext, Bundle bundle) {
        Intent intent = new Intent();
        intent.setClass(mContext, TypeActivity.class);
        intent.putExtra("bundle", bundle);
        mContext.startActivity(intent);
    }

    public static void goAboutActivity(Activity activity, Object o) {
        Intent intent = new Intent();
        intent.setClass(activity, AboutActivity.class);
        activity.startActivity(intent);
    }

    public static void goWeb(Activity activity, String url) {
        Intent intent = new Intent();
        intent.setClass(activity, WebActivity.class);
        intent.putExtra("url", "http://zb.neihangongfang.com/");
        activity.startActivity(intent);
    }
}
